//=============================================================================

#include "filemanager.hpp"

using namespace std;

static string storedPath[ MAX_CAT + 1 ];
static string storedExt[  MAX_CAT + 1 ];

namespace KEG
{

void Dir( int category, const string& str )
{
	if( category == BASE )
	{
		storedPath[ BASE ] = str;
	}
	else
	{
		ostringstream ostr;
		ostr << storedPath[ BASE ] << '/' << str;
		storedPath[ category ] = ostr.str();
	}
}

void LinkDir( int child, int parent )
{
	storedPath[ child ] = storedPath[ parent ];
}

void Ext( int category, const std::string& str )
{
	storedExt[ category ] = str;
}

std::string Path( int category, const std::string& relativePath )
{
	return storedPath[ category ] + "/" + relativePath + storedExt[ category ];
}

}
